package opengameflow.framework.color;

import opengameflow.framework.vector.Vector3;
import opengameflow.framework.vector.Vector4;

public class Color {
	
	private float r;
	private float g;
	private float b;
	private float a;
	
	
	public Color() {
		this(0, 0, 0, 0);
	}
	
	public Color(float red, float green, float blue) {
		this(red, green, blue, 1);
	}
	
	public Color(float red, float green, float blue, float alpha) {
		this.r = red;
		this.g = green;
		this.b = blue;
		this.a = alpha;
	}
	
	public float getRed() 	{ return this.r; }
	public float getGreen() { return this.g; }
	public float getBlue() 	{ return this.b; }
	public float getAlpha() { return this.a; }
	
	public void setRed(float red) 		{ this.r = red; }
	public void setGreen(float green)	{ this.g = green; }
	public void setBlue(float blue)		{ this.b = blue; }
	public void setAlpha(float alpha)	{ this.a = alpha; }

	
	public Vector3 toVector3() {
		return new Vector3(r, g, b);
	}
	
	public Vector4 toVector4() {
		return new Vector4(r, g, b, a);
	}
	
	public boolean equals(Color other) {
		boolean couldBe = r == other.getRed();
		
		couldBe = couldBe && g == other.getGreen();
		couldBe = couldBe && b == other.getBlue();
		
		return couldBe;
	}

}
